phantom.injectJs('spider.js');
spider.addTask({
	//url:'http://www.diandian.com/tag/美女',
	delay: 0,
	url:'http://www.diandian.com/tag/%E7%BE%8E%E5%A5%B3',
	handler: function(){
		var toPost = [];
		$('img.feed-img').each(function(){
			var oriInfo = $(this).attr('data-origin-info');
			if(oriInfo && oriInfo.split(":").length >= 5 ){
				var infos = oriInfo.split(":"),
					pic_url = infos[0] + ":" + infos[1],
					width = parseFloat(infos[2]),
					height = parseFloat(infos[3]),
					key = infos[4];
				console.log(pic_url+"   " + width + "   " + height + "   " + key);
				toPost.push({
					'pic_url' : pic_url,
					'pic_key' : 'diandian_' + key,
					'source' : 'diandian'
				});
			}
			//console.log($(this).attr('data-origin-info') );
		});

		_submit(toPost);
		
		// $.post('http://admin.shenmu.com/remote/new',{pics: JSON.stringify(toPost)}, function(text){
		// 	console.log(text);
		// 	console.log("CMD:exit");
		// 	//phantom.exit();
		// });
	}
});